﻿//********************************************************************************//
//创建日期：<创建日期，2010-08-02>
//创建作者：<王一飞，wangyifei@shanghai3h.com>
//功能说明：QS_LH_YONGHUTZ实体层次
//********************************************************************************//

#region Entity

using System;
using System.Data;
using Entity;
using Oracle.DataAccess.Client;
using Platform.Configuration;
using Platform.Data;

namespace Entity
{
    [Serializable]
    public class QS_LH_YONGHUTZ
    {
        private decimal? m_dec_i_biaoshi;

        private decimal? m_dec_i_jlzt;

        private decimal? m_dec_i_laihanlx;

        private decimal? m_dec_i_no;

        private decimal? m_dec_i_wtype;

        private decimal? m_dec_i_yuanyongh;

        private decimal m_dec_id;

        private decimal? m_dec_n_shuijia;

        private DateTime? m_DT_d_caozuorq;

        private DateTime? m_DT_d_tianjiarq;

        private string m_str_s_bumenbh;

        private string m_str_s_caiwudz;

        private string m_str_s_caiwuhm;

        private string m_str_s_caiwuyb;

        private string m_str_s_caozuor;

        private string m_str_s_destuser;

        private string m_str_s_dianhua;

        private string m_str_s_dizhi;

        private string m_str_s_feetype;

        private string m_str_s_fenpianbh;

        private string m_str_s_hangyebh;

        private string m_str_s_hetongh;

        private string m_str_s_huanxianbj;

        private string m_str_s_jieshuny;

        private string m_str_s_kaihuh;

        private string m_str_s_kaihuhm;

        private string m_str_s_kaihuyh;

        private string m_str_s_kaishiny;

        private string m_str_s_laihanbh;

        private string m_str_s_lianxibm;

        private string m_str_s_lianxir;

        private string m_str_s_liuyubh;

        private string m_str_s_qushuiytbh;

        private string m_str_s_shuiziybh;

        private string m_str_s_tianjiar;

        private string m_str_s_xingzhengqbh;

        private string m_str_s_yewuy;

        private string m_str_s_yinhang;

        private string m_str_s_yonghuh;

        private string m_str_s_yonghum;

        private string m_str_s_youbian;

        private string m_str_s_yuanyonghuh;

        private string m_str_s_zhuangbiaojl;

        private string m_str_s_zhushi;

        /// <summary>
        /// </summary>
        public decimal ID
        {
            get { return m_dec_id; }
            set { m_dec_id = value; }
        }

        /// <summary>
        /// </summary>
        public string S_YONGHUH
        {
            get { return m_str_s_yonghuh; }
            set { m_str_s_yonghuh = value; }
        }

        /// <summary>
        /// </summary>
        public string S_XINGZHENGQBH
        {
            get { return m_str_s_xingzhengqbh; }
            set { m_str_s_xingzhengqbh = value; }
        }

        /// <summary>
        /// </summary>
        public string S_YONGHUM
        {
            get { return m_str_s_yonghum; }
            set { m_str_s_yonghum = value; }
        }

        /// <summary>
        /// </summary>
        public string S_DIZHI
        {
            get { return m_str_s_dizhi; }
            set { m_str_s_dizhi = value; }
        }

        /// <summary>
        /// </summary>
        public string S_YOUBIAN
        {
            get { return m_str_s_youbian; }
            set { m_str_s_youbian = value; }
        }

        /// <summary>
        /// </summary>
        public string S_LIANXIBM
        {
            get { return m_str_s_lianxibm; }
            set { m_str_s_lianxibm = value; }
        }

        /// <summary>
        /// </summary>
        public string S_LIANXIR
        {
            get { return m_str_s_lianxir; }
            set { m_str_s_lianxir = value; }
        }

        /// <summary>
        /// </summary>
        public string S_KAIHUHM
        {
            get { return m_str_s_kaihuhm; }
            set { m_str_s_kaihuhm = value; }
        }

        /// <summary>
        /// </summary>
        public string S_KAIHUYH
        {
            get { return m_str_s_kaihuyh; }
            set { m_str_s_kaihuyh = value; }
        }

        /// <summary>
        /// </summary>
        public string S_YEWUY
        {
            get { return m_str_s_yewuy; }
            set { m_str_s_yewuy = value; }
        }

        /// <summary>
        /// </summary>
        public string S_YUANYONGHUH
        {
            get { return m_str_s_yuanyonghuh; }
            set { m_str_s_yuanyonghuh = value; }
        }

        /// <summary>
        /// </summary>
        public string S_CAIWUDZ
        {
            get { return m_str_s_caiwudz; }
            set { m_str_s_caiwudz = value; }
        }

        /// <summary>
        /// </summary>
        public string S_CAIWUYB
        {
            get { return m_str_s_caiwuyb; }
            set { m_str_s_caiwuyb = value; }
        }

        /// <summary>
        /// </summary>
        public decimal? I_JLZT
        {
            get { return m_dec_i_jlzt; }
            set { m_dec_i_jlzt = value; }
        }

        /// <summary>
        /// </summary>
        public string S_CAOZUOR
        {
            get { return m_str_s_caozuor; }
            set { m_str_s_caozuor = value; }
        }

        /// <summary>
        /// </summary>
        public string S_BUMENBH
        {
            get { return m_str_s_bumenbh; }
            set { m_str_s_bumenbh = value; }
        }

        /// <summary>
        /// </summary>
        public string S_DIANHUA
        {
            get { return m_str_s_dianhua; }
            set { m_str_s_dianhua = value; }
        }

        /// <summary>
        /// </summary>
        public string S_LIUYUBH
        {
            get { return m_str_s_liuyubh; }
            set { m_str_s_liuyubh = value; }
        }

        /// <summary>
        /// </summary>
        public string S_SHUIZIYBH
        {
            get { return m_str_s_shuiziybh; }
            set { m_str_s_shuiziybh = value; }
        }

        /// <summary>
        /// </summary>
        public string S_FENPIANBH
        {
            get { return m_str_s_fenpianbh; }
            set { m_str_s_fenpianbh = value; }
        }

        /// <summary>
        /// </summary>
        public string S_HUANXIANBJ
        {
            get { return m_str_s_huanxianbj; }
            set { m_str_s_huanxianbj = value; }
        }

        /// <summary>
        /// </summary>
        public string S_QUSHUIYTBH
        {
            get { return m_str_s_qushuiytbh; }
            set { m_str_s_qushuiytbh = value; }
        }

        /// <summary>
        /// </summary>
        public string S_HANGYEBH
        {
            get { return m_str_s_hangyebh; }
            set { m_str_s_hangyebh = value; }
        }

        /// <summary>
        /// </summary>
        public decimal? N_SHUIJIA
        {
            get { return m_dec_n_shuijia; }
            set { m_dec_n_shuijia = value; }
        }

        /// <summary>
        /// </summary>
        public decimal? I_BIAOSHI
        {
            get { return m_dec_i_biaoshi; }
            set { m_dec_i_biaoshi = value; }
        }

        /// <summary>
        /// </summary>
        public string S_KAIHUH
        {
            get { return m_str_s_kaihuh; }
            set { m_str_s_kaihuh = value; }
        }

        /// <summary>
        /// </summary>
        public string S_ZHUSHI
        {
            get { return m_str_s_zhushi; }
            set { m_str_s_zhushi = value; }
        }

        /// <summary>
        /// </summary>
        public decimal? I_WTYPE
        {
            get { return m_dec_i_wtype; }
            set { m_dec_i_wtype = value; }
        }

        /// <summary>
        /// </summary>
        public string S_TIANJIAR
        {
            get { return m_str_s_tianjiar; }
            set { m_str_s_tianjiar = value; }
        }

        /// <summary>
        /// </summary>
        public DateTime? D_TIANJIARQ
        {
            get { return m_DT_d_tianjiarq; }
            set { m_DT_d_tianjiarq = value; }
        }

        /// <summary>
        /// </summary>
        public DateTime? D_CAOZUORQ
        {
            get { return m_DT_d_caozuorq; }
            set { m_DT_d_caozuorq = value; }
        }

        /// <summary>
        /// </summary>
        public string S_DESTUSER
        {
            get { return m_str_s_destuser; }
            set { m_str_s_destuser = value; }
        }

        /// <summary>
        /// </summary>
        public string S_KAISHINY
        {
            get { return m_str_s_kaishiny; }
            set { m_str_s_kaishiny = value; }
        }

        /// <summary>
        /// </summary>
        public string S_JIESHUNY
        {
            get { return m_str_s_jieshuny; }
            set { m_str_s_jieshuny = value; }
        }

        /// <summary>
        /// </summary>
        public string S_HETONGH
        {
            get { return m_str_s_hetongh; }
            set { m_str_s_hetongh = value; }
        }

        /// <summary>
        /// </summary>
        public string S_YINHANG
        {
            get { return m_str_s_yinhang; }
            set { m_str_s_yinhang = value; }
        }

        /// <summary>
        /// </summary>
        public string S_CAIWUHM
        {
            get { return m_str_s_caiwuhm; }
            set { m_str_s_caiwuhm = value; }
        }

        /// <summary>
        /// </summary>
        public string S_ZHUANGBIAOJL
        {
            get { return m_str_s_zhuangbiaojl; }
            set { m_str_s_zhuangbiaojl = value; }
        }

        /// <summary>
        /// </summary>
        public string S_FEETYPE
        {
            get { return m_str_s_feetype; }
            set { m_str_s_feetype = value; }
        }

        /// <summary>
        /// </summary>
        public string S_LAIHANBH
        {
            get { return m_str_s_laihanbh; }
            set { m_str_s_laihanbh = value; }
        }

        /// <summary>
        /// </summary>
        public decimal? I_LAIHANLX
        {
            get { return m_dec_i_laihanlx; }
            set { m_dec_i_laihanlx = value; }
        }

        /// <summary>
        /// </summary>
        public decimal? I_YUANYONGH
        {
            get { return m_dec_i_yuanyongh; }
            set { m_dec_i_yuanyongh = value; }
        }

        /// <summary>
        ///     用户标识分户结果用户顺序
        /// </summary>
        public decimal? I_NO
        {
            get { return m_dec_i_no; }
            set { m_dec_i_no = value; }
        }
    }
}

#endregion

#region EntityProcess

namespace BLL.Access
{
    //using System.Data.OracleClient;

    public class QS_LH_YONGHUTZProcess
    {
        #region Field

        protected string conn;

        #endregion

        #region Construction

        public QS_LH_YONGHUTZProcess()
        {
            conn = ConfigHelper.PlatformConnString;
        }

        #endregion

        #region public

        /// <summary>
        ///     根据QS_LH_YONGHUTZ实体添加或者修改QS_LH_YONGHUTZ信息
        /// </summary>
        public bool InsertOrUpdate(QS_LH_YONGHUTZ QS_LH_YONGHUTZ, OracleTransaction Transaction)
        {
            if (QS_LH_YONGHUTZ.ID == 0)
                InsertQS_LH_YONGHUTZ(QS_LH_YONGHUTZ, Transaction);
            else
                UpdateQS_LH_YONGHUTZ(QS_LH_YONGHUTZ, Transaction);
            return QS_LH_YONGHUTZ.ID == 0 ? false : true;
        }

        /// <summary>
        ///     根据QS_LH_YONGHUTZ实体添加或修改QS_LH_YONGHUTZ信息
        /// </summary>
        public bool InsertOrUpdate(QS_LH_YONGHUTZ QS_LH_YONGHUTZ)
        {
            return InsertOrUpdate(QS_LH_YONGHUTZ, null);
        }


        /// <summary>
        ///     根据QS_LH_YONGHUTZ主键删除QS_LH_YONGHUTZ信息
        /// </summary>
        /// <param name="ID"></param>
        public bool DeleteQS_LH_YONGHUTZ(decimal ID, OracleTransaction Transaction)
        {
            var spName = "CS_DelQS_LH_YONGHUTZ";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = ID;
            var result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery(Transaction, CommandType.StoredProcedure, spName, storedParams);
            return result == 0 ? false : true;
        }

        /// <summary>
        ///     根据QS_LH_YONGHUTZ主键删除QS_LH_YONGHUTZ信息
        /// </summary>
        /// <param name="ID"></param>
        public bool DeleteQS_LH_YONGHUTZ(decimal ID)
        {
            return DeleteQS_LH_YONGHUTZ(ID, null);
        }

        /// <summary>
        ///     根据条件删除QS_LH_YONGHUTZ信息
        /// </summary>
        /// <param name="WhereClause">条件子句(Oracle语句)不带where</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>如果删除成功，返回true,否则返回fals</returns>
        public bool DeleteQS_LH_YONGHUTZsDynamic(string WhereClause, OracleTransaction Transaction)
        {
            var spName = "CS_DelQS_LH_YONGHUTZsDyn";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = WhereClause;
            var result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery(Transaction, CommandType.StoredProcedure, spName, storedParams);
            return result == 0 ? false : true;
        }

        /// <summary>
        ///     根据条件删除QS_LH_YONGHUTZ信息
        /// </summary>
        /// <param name="WhereClause">条件子句(Oracle语句)不带where</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>如果删除成功，返回true,否则返回fals</returns>
        public bool DeleteQS_LH_YONGHUTZsDynamic(string WhereClause)
        {
            return DeleteQS_LH_YONGHUTZsDynamic(WhereClause, null);
        }

        /// <summary>
        ///     根据QS_LH_YONGHUTZ主键选择QS_LH_YONGHUTZ信息
        /// </summary>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>QS_LH_YONGHUTZ信息</returns>
        public QS_LH_YONGHUTZ SelectQS_LH_YONGHUTZ(decimal ID, OracleTransaction Transaction)
        {
            var spName = "CS_SelQS_LH_YONGHUTZ";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = ID;
            OracleDataReader rd;
            if (Transaction == null)
                rd = OracleHelper.ExecuteReader(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                rd = OracleHelper.ExecuteReader(Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (rd.Read())
            {
                var QS_LH_YONGHUTZ = PopulateQS_LH_YONGHUTZ(rd);
                rd.Close();
                return QS_LH_YONGHUTZ;
            }
            return null;
        }

        /// <summary>
        ///     根据QS_LH_YONGHUTZ主键选择QS_LH_YONGHUTZ信息
        /// </summary>
        /// <returns>QS_LH_YONGHUTZ信息</returns>
        public QS_LH_YONGHUTZ SelectQS_LH_YONGHUTZ(decimal ID)
        {
            return SelectQS_LH_YONGHUTZ(ID, null);
        }

        /// <summary>
        ///     选择所有QS_LH_YONGHUTZ信息
        /// </summary>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>所有QS_LH_YONGHUTZ信息</returns>
        public DataTable SelectQS_LH_YONGHUTZsAll(OracleTransaction Transaction)
        {
            var spName = "CS_SelQS_LH_YONGHUTZsAll";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            DataSet ds = null;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset(Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (ds != null && ds.Tables.Count > 0)
            {
                AddRowNumber(ds.Tables[0]);
                return ds.Tables[0];
            }
            return null;
        }

        /// <summary>
        ///     选择所有QS_LH_YONGHUTZ信息
        /// </summary>
        /// <returns>所有QS_LH_YONGHUTZ信息</returns>
        public DataTable SelectQS_LH_YONGHUTZsAll()
        {
            return SelectQS_LH_YONGHUTZsAll(null);
        }

        /// <summary>
        ///     根据条件选择QS_LH_YONGHUTZ信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>QS_LH_YONGHUTZ信息</returns>
        public DataTable SelectQS_LH_YONGHUTZsDynamic(string WhereClause, string OrderByExpression,
            OracleTransaction Transaction)
        {
            var spName = "CS_SelQS_LH_YONGHUTZsDyn";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = string.IsNullOrEmpty(WhereClause.Trim()) ? "1=1" : WhereClause;
            storedParams[1].Value = OrderByExpression;
            DataSet ds = null;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset(Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (ds != null && ds.Tables.Count > 0)
            {
                AddRowNumber(ds.Tables[0]);
                return ds.Tables[0];
            }
            return null;
        }


        /// <summary>
        ///     根据条件选择QS_LH_YONGHUTZ信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <returns>QS_LH_YONGHUTZ信息</returns>
        public DataTable SelectQS_LH_YONGHUTZsDynamic(string WhereClause, string OrderByExpression)
        {
            return SelectQS_LH_YONGHUTZsDynamic(WhereClause, OrderByExpression, null);
        }


        /// <summary>
        ///     根据条件选择QS_LH_YONGHUTZ信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <param name="PageIndex">页码</param>
        /// <param name="PageSize">页数</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>QS_LH_YONGHUTZ信息</returns>
        public DataTable SelectQS_LH_YONGHUTZsDynamic(string WhereClause, string OrderByExpression, int PageIndex,
            int PageSize, OracleTransaction Transaction)
        {
            var spName = "CS_SelQS_LH_YONGHUTZsDynPaged";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = string.IsNullOrEmpty(WhereClause.Trim()) ? "1=1" : WhereClause;
            storedParams[1].Value = OrderByExpression;
            storedParams[2].Value = PageIndex;
            storedParams[3].Value = PageSize;
            DataSet ds = null;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset(Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (ds != null && ds.Tables.Count > 0)
            {
                AddRowNumber(ds.Tables[0]);
                return ds.Tables[0];
            }
            return null;
        }


        /// <summary>
        ///     根据条件选择QS_LH_YONGHUTZ信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <param name="PageIndex">页码</param>
        /// <param name="PageSize">页数</param>
        /// <returns>QS_LH_YONGHUTZ信息</returns>
        public DataTable SelectQS_LH_YONGHUTZsDynamic(string WhereClause, string OrderByExpression, int PageIndex,
            int PageSize)
        {
            return SelectQS_LH_YONGHUTZsDynamic(WhereClause, OrderByExpression, PageIndex, PageSize, null);
        }

        /// <summary>
        ///     根据条件更新QS_LH_YONGHUTZ字段
        /// </summary>
        /// <returns>受影响行数</returns>
        public int UpdateQS_LH_YONGHUTZsDynamic(string UpdateValue, string WhereClause, OracleTransaction Transaction)
        {
            var result = 0;
            if (UpdateValue == "" || WhereClause == "")
                return 0;
            var spName = "CS_UpdQS_LH_YONGHUTZDyn";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            DataSet ds = null;
            storedParams[0].Value = UpdateValue;
            storedParams[1].Value = WhereClause;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset(Transaction, CommandType.StoredProcedure, spName, storedParams);
            result = Convert.ToInt32(storedParams[2].Value);
            return result;
        }

        /// <summary>
        ///     根据条件更新QS_LH_YONGHUTZ字段
        /// </summary>
        /// <returns>受影响行数</returns>
        public int UpdateQS_LH_YONGHUTZsDynamic(string UpdateValue, string WhereClause)
        {
            return UpdateQS_LH_YONGHUTZsDynamic(UpdateValue, WhereClause, null);
        }

        #endregion

        #region Private

        private int InsertQS_LH_YONGHUTZ(QS_LH_YONGHUTZ QS_LH_YONGHUTZ, OracleTransaction Transaction)
        {
            var spName = "CS_InsQS_LH_YONGHUTZ";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = QS_LH_YONGHUTZ.S_YONGHUH;
            storedParams[1].Value = QS_LH_YONGHUTZ.S_XINGZHENGQBH;
            storedParams[2].Value = QS_LH_YONGHUTZ.S_YONGHUM;
            storedParams[3].Value = QS_LH_YONGHUTZ.S_DIZHI;
            storedParams[4].Value = QS_LH_YONGHUTZ.S_YOUBIAN;
            storedParams[5].Value = QS_LH_YONGHUTZ.S_LIANXIBM;
            storedParams[6].Value = QS_LH_YONGHUTZ.S_LIANXIR;
            storedParams[7].Value = QS_LH_YONGHUTZ.S_KAIHUHM;
            storedParams[8].Value = QS_LH_YONGHUTZ.S_KAIHUYH;
            storedParams[9].Value = QS_LH_YONGHUTZ.S_YEWUY;
            storedParams[10].Value = QS_LH_YONGHUTZ.S_YUANYONGHUH;
            storedParams[11].Value = QS_LH_YONGHUTZ.S_CAIWUDZ;
            storedParams[12].Value = QS_LH_YONGHUTZ.S_CAIWUYB;
            storedParams[13].Value = QS_LH_YONGHUTZ.I_JLZT;
            storedParams[14].Value = QS_LH_YONGHUTZ.S_CAOZUOR;
            storedParams[15].Value = QS_LH_YONGHUTZ.S_BUMENBH;
            storedParams[16].Value = QS_LH_YONGHUTZ.S_DIANHUA;
            storedParams[17].Value = QS_LH_YONGHUTZ.S_LIUYUBH;
            storedParams[18].Value = QS_LH_YONGHUTZ.S_SHUIZIYBH;
            storedParams[19].Value = QS_LH_YONGHUTZ.S_FENPIANBH;
            storedParams[20].Value = QS_LH_YONGHUTZ.S_HUANXIANBJ;
            storedParams[21].Value = QS_LH_YONGHUTZ.S_QUSHUIYTBH;
            storedParams[22].Value = QS_LH_YONGHUTZ.S_HANGYEBH;
            storedParams[23].Value = QS_LH_YONGHUTZ.N_SHUIJIA;
            storedParams[24].Value = QS_LH_YONGHUTZ.I_BIAOSHI;
            storedParams[25].Value = QS_LH_YONGHUTZ.S_KAIHUH;
            storedParams[26].Value = QS_LH_YONGHUTZ.S_ZHUSHI;
            storedParams[27].Value = QS_LH_YONGHUTZ.I_WTYPE;
            storedParams[28].Value = QS_LH_YONGHUTZ.S_TIANJIAR;
            storedParams[29].Value = QS_LH_YONGHUTZ.D_TIANJIARQ;
            storedParams[30].Value = QS_LH_YONGHUTZ.D_CAOZUORQ;
            storedParams[31].Value = QS_LH_YONGHUTZ.S_DESTUSER;
            storedParams[32].Value = QS_LH_YONGHUTZ.S_KAISHINY;
            storedParams[33].Value = QS_LH_YONGHUTZ.S_JIESHUNY;
            storedParams[34].Value = QS_LH_YONGHUTZ.S_HETONGH;
            storedParams[35].Value = QS_LH_YONGHUTZ.S_YINHANG;
            storedParams[36].Value = QS_LH_YONGHUTZ.S_CAIWUHM;
            storedParams[37].Value = QS_LH_YONGHUTZ.S_ZHUANGBIAOJL;
            storedParams[38].Value = QS_LH_YONGHUTZ.S_FEETYPE;
            storedParams[39].Value = QS_LH_YONGHUTZ.S_LAIHANBH;
            storedParams[40].Value = QS_LH_YONGHUTZ.I_LAIHANLX;
            storedParams[41].Value = QS_LH_YONGHUTZ.I_YUANYONGH;
            storedParams[42].Value = QS_LH_YONGHUTZ.I_NO;
            var result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery(Transaction, CommandType.StoredProcedure, spName, storedParams);
            QS_LH_YONGHUTZ.ID = Convert.ToInt32(storedParams[43].Value);
            return result;
        }

        private bool UpdateQS_LH_YONGHUTZ(QS_LH_YONGHUTZ QS_LH_YONGHUTZ, OracleTransaction Transaction)
        {
            var spName = "CS_UpdQS_LH_YONGHUTZ";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = QS_LH_YONGHUTZ.S_YONGHUH;
            storedParams[1].Value = QS_LH_YONGHUTZ.S_XINGZHENGQBH;
            storedParams[2].Value = QS_LH_YONGHUTZ.S_YONGHUM;
            storedParams[3].Value = QS_LH_YONGHUTZ.S_DIZHI;
            storedParams[4].Value = QS_LH_YONGHUTZ.S_YOUBIAN;
            storedParams[5].Value = QS_LH_YONGHUTZ.S_LIANXIBM;
            storedParams[6].Value = QS_LH_YONGHUTZ.S_LIANXIR;
            storedParams[7].Value = QS_LH_YONGHUTZ.S_KAIHUHM;
            storedParams[8].Value = QS_LH_YONGHUTZ.S_KAIHUYH;
            storedParams[9].Value = QS_LH_YONGHUTZ.S_YEWUY;
            storedParams[10].Value = QS_LH_YONGHUTZ.S_YUANYONGHUH;
            storedParams[11].Value = QS_LH_YONGHUTZ.S_CAIWUDZ;
            storedParams[12].Value = QS_LH_YONGHUTZ.S_CAIWUYB;
            storedParams[13].Value = QS_LH_YONGHUTZ.I_JLZT;
            storedParams[14].Value = QS_LH_YONGHUTZ.S_CAOZUOR;
            storedParams[15].Value = QS_LH_YONGHUTZ.S_BUMENBH;
            storedParams[16].Value = QS_LH_YONGHUTZ.S_DIANHUA;
            storedParams[17].Value = QS_LH_YONGHUTZ.S_LIUYUBH;
            storedParams[18].Value = QS_LH_YONGHUTZ.S_SHUIZIYBH;
            storedParams[19].Value = QS_LH_YONGHUTZ.S_FENPIANBH;
            storedParams[20].Value = QS_LH_YONGHUTZ.S_HUANXIANBJ;
            storedParams[21].Value = QS_LH_YONGHUTZ.S_QUSHUIYTBH;
            storedParams[22].Value = QS_LH_YONGHUTZ.S_HANGYEBH;
            storedParams[23].Value = QS_LH_YONGHUTZ.N_SHUIJIA;
            storedParams[24].Value = QS_LH_YONGHUTZ.I_BIAOSHI;
            storedParams[25].Value = QS_LH_YONGHUTZ.S_KAIHUH;
            storedParams[26].Value = QS_LH_YONGHUTZ.S_ZHUSHI;
            storedParams[27].Value = QS_LH_YONGHUTZ.I_WTYPE;
            storedParams[28].Value = QS_LH_YONGHUTZ.S_TIANJIAR;
            storedParams[29].Value = QS_LH_YONGHUTZ.D_TIANJIARQ;
            storedParams[30].Value = QS_LH_YONGHUTZ.D_CAOZUORQ;
            storedParams[31].Value = QS_LH_YONGHUTZ.S_DESTUSER;
            storedParams[32].Value = QS_LH_YONGHUTZ.S_KAISHINY;
            storedParams[33].Value = QS_LH_YONGHUTZ.S_JIESHUNY;
            storedParams[34].Value = QS_LH_YONGHUTZ.S_HETONGH;
            storedParams[35].Value = QS_LH_YONGHUTZ.S_YINHANG;
            storedParams[36].Value = QS_LH_YONGHUTZ.S_CAIWUHM;
            storedParams[37].Value = QS_LH_YONGHUTZ.S_ZHUANGBIAOJL;
            storedParams[38].Value = QS_LH_YONGHUTZ.S_FEETYPE;
            storedParams[39].Value = QS_LH_YONGHUTZ.S_LAIHANBH;
            storedParams[40].Value = QS_LH_YONGHUTZ.I_LAIHANLX;
            storedParams[41].Value = QS_LH_YONGHUTZ.I_YUANYONGH;
            storedParams[42].Value = QS_LH_YONGHUTZ.I_NO;
            storedParams[43].Value = QS_LH_YONGHUTZ.ID;
            var result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery(Transaction, CommandType.StoredProcedure, spName, storedParams);
            return result == 0 ? false : true;
        }


        private QS_LH_YONGHUTZ PopulateQS_LH_YONGHUTZ(IDataReader dr)
        {
            var QS_LH_YONGHUTZ = new QS_LH_YONGHUTZ();
            QS_LH_YONGHUTZ.ID = dr["ID"] == DBNull.Value ? 0 : (decimal) dr["ID"];
            QS_LH_YONGHUTZ.S_YONGHUH = dr["S_YONGHUH"] == DBNull.Value ? null : (string) dr["S_YONGHUH"];
            QS_LH_YONGHUTZ.S_XINGZHENGQBH = dr["S_XINGZHENGQBH"] == DBNull.Value ? null : (string) dr["S_XINGZHENGQBH"];
            QS_LH_YONGHUTZ.S_YONGHUM = dr["S_YONGHUM"] == DBNull.Value ? null : (string) dr["S_YONGHUM"];
            QS_LH_YONGHUTZ.S_DIZHI = dr["S_DIZHI"] == DBNull.Value ? null : (string) dr["S_DIZHI"];
            QS_LH_YONGHUTZ.S_YOUBIAN = dr["S_YOUBIAN"] == DBNull.Value ? null : (string) dr["S_YOUBIAN"];
            QS_LH_YONGHUTZ.S_LIANXIBM = dr["S_LIANXIBM"] == DBNull.Value ? null : (string) dr["S_LIANXIBM"];
            QS_LH_YONGHUTZ.S_LIANXIR = dr["S_LIANXIR"] == DBNull.Value ? null : (string) dr["S_LIANXIR"];
            QS_LH_YONGHUTZ.S_KAIHUHM = dr["S_KAIHUHM"] == DBNull.Value ? null : (string) dr["S_KAIHUHM"];
            QS_LH_YONGHUTZ.S_KAIHUYH = dr["S_KAIHUYH"] == DBNull.Value ? null : (string) dr["S_KAIHUYH"];
            QS_LH_YONGHUTZ.S_YEWUY = dr["S_YEWUY"] == DBNull.Value ? null : (string) dr["S_YEWUY"];
            QS_LH_YONGHUTZ.S_YUANYONGHUH = dr["S_YUANYONGHUH"] == DBNull.Value ? null : (string) dr["S_YUANYONGHUH"];
            QS_LH_YONGHUTZ.S_CAIWUDZ = dr["S_CAIWUDZ"] == DBNull.Value ? null : (string) dr["S_CAIWUDZ"];
            QS_LH_YONGHUTZ.S_CAIWUYB = dr["S_CAIWUYB"] == DBNull.Value ? null : (string) dr["S_CAIWUYB"];
            QS_LH_YONGHUTZ.I_JLZT = dr["I_JLZT"] == DBNull.Value ? null : (decimal?) dr["I_JLZT"];
            QS_LH_YONGHUTZ.S_CAOZUOR = dr["S_CAOZUOR"] == DBNull.Value ? null : (string) dr["S_CAOZUOR"];
            QS_LH_YONGHUTZ.S_BUMENBH = dr["S_BUMENBH"] == DBNull.Value ? null : (string) dr["S_BUMENBH"];
            QS_LH_YONGHUTZ.S_DIANHUA = dr["S_DIANHUA"] == DBNull.Value ? null : (string) dr["S_DIANHUA"];
            QS_LH_YONGHUTZ.S_LIUYUBH = dr["S_LIUYUBH"] == DBNull.Value ? null : (string) dr["S_LIUYUBH"];
            QS_LH_YONGHUTZ.S_SHUIZIYBH = dr["S_SHUIZIYBH"] == DBNull.Value ? null : (string) dr["S_SHUIZIYBH"];
            QS_LH_YONGHUTZ.S_FENPIANBH = dr["S_FENPIANBH"] == DBNull.Value ? null : (string) dr["S_FENPIANBH"];
            QS_LH_YONGHUTZ.S_HUANXIANBJ = dr["S_HUANXIANBJ"] == DBNull.Value ? null : (string) dr["S_HUANXIANBJ"];
            QS_LH_YONGHUTZ.S_QUSHUIYTBH = dr["S_QUSHUIYTBH"] == DBNull.Value ? null : (string) dr["S_QUSHUIYTBH"];
            QS_LH_YONGHUTZ.S_HANGYEBH = dr["S_HANGYEBH"] == DBNull.Value ? null : (string) dr["S_HANGYEBH"];
            QS_LH_YONGHUTZ.N_SHUIJIA = dr["N_SHUIJIA"] == DBNull.Value ? null : (decimal?) dr["N_SHUIJIA"];
            QS_LH_YONGHUTZ.I_BIAOSHI = dr["I_BIAOSHI"] == DBNull.Value ? null : (decimal?) dr["I_BIAOSHI"];
            QS_LH_YONGHUTZ.S_KAIHUH = dr["S_KAIHUH"] == DBNull.Value ? null : (string) dr["S_KAIHUH"];
            QS_LH_YONGHUTZ.S_ZHUSHI = dr["S_ZHUSHI"] == DBNull.Value ? null : (string) dr["S_ZHUSHI"];
            QS_LH_YONGHUTZ.I_WTYPE = dr["I_WTYPE"] == DBNull.Value ? null : (decimal?) dr["I_WTYPE"];
            QS_LH_YONGHUTZ.S_TIANJIAR = dr["S_TIANJIAR"] == DBNull.Value ? null : (string) dr["S_TIANJIAR"];
            QS_LH_YONGHUTZ.D_TIANJIARQ = dr["D_TIANJIARQ"] == DBNull.Value ? null : (DateTime?) dr["D_TIANJIARQ"];
            QS_LH_YONGHUTZ.D_CAOZUORQ = dr["D_CAOZUORQ"] == DBNull.Value ? null : (DateTime?) dr["D_CAOZUORQ"];
            QS_LH_YONGHUTZ.S_DESTUSER = dr["S_DESTUSER"] == DBNull.Value ? null : (string) dr["S_DESTUSER"];
            QS_LH_YONGHUTZ.S_KAISHINY = dr["S_KAISHINY"] == DBNull.Value ? null : (string) dr["S_KAISHINY"];
            QS_LH_YONGHUTZ.S_JIESHUNY = dr["S_JIESHUNY"] == DBNull.Value ? null : (string) dr["S_JIESHUNY"];
            QS_LH_YONGHUTZ.S_HETONGH = dr["S_HETONGH"] == DBNull.Value ? null : (string) dr["S_HETONGH"];
            QS_LH_YONGHUTZ.S_YINHANG = dr["S_YINHANG"] == DBNull.Value ? null : (string) dr["S_YINHANG"];
            QS_LH_YONGHUTZ.S_CAIWUHM = dr["S_CAIWUHM"] == DBNull.Value ? null : (string) dr["S_CAIWUHM"];
            QS_LH_YONGHUTZ.S_ZHUANGBIAOJL = dr["S_ZHUANGBIAOJL"] == DBNull.Value ? null : (string) dr["S_ZHUANGBIAOJL"];
            QS_LH_YONGHUTZ.S_FEETYPE = dr["S_FEETYPE"] == DBNull.Value ? null : (string) dr["S_FEETYPE"];
            QS_LH_YONGHUTZ.S_LAIHANBH = dr["S_LAIHANBH"] == DBNull.Value ? null : (string) dr["S_LAIHANBH"];
            QS_LH_YONGHUTZ.I_LAIHANLX = dr["I_LAIHANLX"] == DBNull.Value ? null : (decimal?) dr["I_LAIHANLX"];
            QS_LH_YONGHUTZ.I_YUANYONGH = dr["I_YUANYONGH"] == DBNull.Value ? null : (decimal?) dr["I_YUANYONGH"];
            QS_LH_YONGHUTZ.I_NO = dr["I_NO"] == DBNull.Value ? null : (decimal?) dr["I_NO"];
            return QS_LH_YONGHUTZ;
        }


        private void AddRowNumber(DataTable dt)
        {
            dt.Columns.Add(new DataColumn("RowNumber", typeof(int)));
            for (var i = 0; i < dt.Rows.Count; i++)
                dt.Rows[i][dt.Columns.Count - 1] = i + 1;
        }

        #endregion
    }
}

#endregion